package cn.tedu.store.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class Test1 {
	@Around("bean(userService)||bean(addressService)")
	public Object test(ProceedingJoinPoint pd)
			throws Throwable{
		long start = System.currentTimeMillis();
		Object obj = pd.proceed();
		long end = System.currentTimeMillis();
		System.out.println(end-start);
		return obj;
	}

	@Around("execution(* cn.tedu.store..UserService.login(..))")
	public Object test3(ProceedingJoinPoint pd)
			throws Throwable{
		System.out.println("execution..............");
		long start = System.currentTimeMillis();
		Object obj = pd.proceed();
		long end = System.currentTimeMillis();
		System.out.println(end-start);
		return obj;
	}
	

}







